
import { request } from "@/common/request";
// +---------------------
// | 点餐 / 电订单
// +---------------------

/**
 * 菜品分类
 * @param {*} data 
 * @returns 
 */
export function getFoolTypeList(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/lazy-list`,
    method: "get",
    data,
  });
}

/** 
 * 食物查询
 */
export function getFoodList(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/list`,
    method: "get",
    data,
  });
}

/**
 * 食物查询 （消费机/APP）
 */
export function getFoodAppList(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/appList`,
    method: "get",
    data,
  });
}


/** 
 * 订单查询
 */
export function getBuffetOrderList(data: any) {
  return request({
    url: `/kingon-service-order/kingon-warehousesupplier/buffetOrder/list`,
    method: "get",
    data,
  });
}

/** 
 * 订单详情
 */
export function getBuffetOrderDetail(data: any) {
  return request({
    url: `/kingon-service-order/kingon-warehousesupplier/buffetOrder/detail`,
    method: "get",
    data,
  });
}

/** 
 * 订单组详情 （使用 parentId 查询）
 */
export function getBuffetOrderDetailByPrentId(data: any) {
  return request({
    url: `/kingon-service-order/kingon-warehousesupplier/buffetOrder/detailByPrentId`,
    method: "get",
    data,
  });
}

/**
 * 菜品管理（食物管理）
 */
export function foodList(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/list`,
    method: "get",
    data,
  });
}

/**
 * 食物详情
 */
export function foodDetails(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/detail`,
    method: "get",
    data,
  });
}

/**
 * 修改食物
 */
export function foodEdit(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/update`,
    method: "post",
    data,
  });
}


/**
 * 新增食物
 */
export function foodAdd(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/save`,
    method: "post",
    data,
  });
}

/**
 * 删除食物
 */
export function foodDel(data: any) {
  return request({
    url: `/kingon-service-base/kingon-warehousesupplier/foodType/remove`,
    method: "get",
    data,
  });
}


/**
 *  各种数据聚合接口  原料列表 / 餐别列表 （4）
 */
export function materialRecipeLevelList(data: any) {
  return request({
    url: `/kingon-service-base/kingon-sale/materialRecipeLevel/list`,
    method: "get",
    data,
  });
}


/**
 * 原料分类
 */
export function materialRecipeLevelTypeList(data: any) {
  return request({
    url: `/kingon-service-base/kingon-sale/materialRecipeLevel/lazy-list`,
    method: "get",
    data,
  });
}

/** 查询订单统计 */
export function buffetOrderListMone(data: {orderStatus: number, orderType:number}) {
  return request({
    url: `/kingon-service-order/kingon-warehousesupplier/buffetOrder/listMoney`,
    method: "get",
    data,
  });
}
